<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>kq.1.06上传</title>
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
<script src="../kq.1.06.dev.js"></script>
</head>

<body>
<button id="simpleUpload">简单文件上传</button>
<button id="moreUpload">多文件上传</button>
</body>
<script>
$Q.config('DEBUG',true);
</script>
<script>
$Q('#simpleUpload').click(function(){
	$Q.upload({
		action:'https://api.kuoqps.cn/upload/image',
		data:{
			app_key:'a3EyMTEyMjg1MjkyOmJmYzI2MTFlYWVkMDNkNzlmZDg1YTcxYWQxNjQxNDFlNmQxMjA0Y2Y=',
		},
		//secSize:0,//不启用切片
		secSize:0,//不启用切片
		
		//成功返回
		success:function(rs){
			console.log('上传成功，返回信息如下：');
			console.log(rs);
			console.log(this);
			$Q.msg({
				text:'已上传完成',
				position:'br',	
			})
			
		},
		
		//失败返回
		error:function(rs){
			console.log('上传失败，返回信息如下：');
			console.log(rs);
			console.log(this);
		},
		
		//进度条君
		progress:function(rs){
			$Q.msg({
				text:'已上传'+rs.perSize,
				position:'br',	
			})
		},
	});
});
</script>
<script>
$Q('#moreUpload').click(function(){
	$Q.upload({
		action:'http://api.kuoqps.com/Resource/Demo',
		multiple:true,
		success:function(){console.log('文件上传成功');},
		error:function(){console.log('文件上传失败');},
		progress:function(){console.log('进度器');},		
	});
	console.log(this);	
});
</script>
</html>
